#include <opencv/cv.h>
#include <opencv/highgui.h>

#include "kernels.h"

int main () {
	IplImage *img;
	int i, j;
	/* pad boundaries with empty cells */
	cell Cells [(M+N+N)*(M+N+N)];
	
	launch (Cells);
	
	img = cvCreateImage (cvSize (M+N+N, M+N+N), IPL_DEPTH_32F, 3);
	
	cell *pos = Cells;
	for (i = 0; i < M+N+N; ++i) {
		for (j = 0; j < M+N+N; ++j) {
//			cvSet2D (img, i,j, cvScalar (pos->u, pos->v, pos->w, 0));
						cvSet2D (img, i,j, cvScalar (pos->u, 0.0, 0.0, 1.0));
			++pos;
		}
	}
	
	cvNamedWindow ("output", CV_WINDOW_AUTOSIZE);
	cvShowImage ("output", img);
	
	cvWaitKey (0);
	
	cvDestroyWindow ("output");
	cvReleaseImage (&img);
}
